<html>
<head><meta charset="utf-8"><title>meeting 2021-03-30 · project-const-generics · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/index.html">project-const-generics</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html">meeting 2021-03-30</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="232391768"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232391768" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232391768">(Mar 30 2021 at 08:38)</a>:</h4>
<p>meeting in a bit more than 6 hours at <time datetime="2021-03-30T14:45:00Z">2021-03-30T16:45:00+02:00</time></p>



<a name="232391859"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232391859" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232391859">(Mar 30 2021 at 08:39)</a>:</h4>
<p>i think this is the case for all of europe, but it is now again an hour later for me because of daylight saving time</p>



<a name="232437569"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232437569" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232437569">(Mar 30 2021 at 14:45)</a>:</h4>
<p>well then, <span class="user-group-mention" data-user-group-id="3805">@project-const-generics</span></p>



<a name="232437587"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232437587" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232437587">(Mar 30 2021 at 14:45)</a>:</h4>
<p>it's meeting time</p>



<a name="232437722"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232437722" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232437722">(Mar 30 2021 at 14:46)</a>:</h4>
<p>highly professional meeting notes: <a href="https://hackmd.io/mOABg7lVTGKTBihOf6fcvg">https://hackmd.io/mOABg7lVTGKTBihOf6fcvg</a></p>



<a name="232438155"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232438155" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232438155">(Mar 30 2021 at 14:48)</a>:</h4>
<p>also an announcement, i won't be able to participate in the cg meeting next week due to university</p>



<a name="232438300"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232438300" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232438300">(Mar 30 2021 at 14:48)</a>:</h4>
<p>so unless there's something you want to discuss without me, it's probably easiest to just skip that one</p>



<a name="232438531"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232438531" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232438531">(Mar 30 2021 at 14:50)</a>:</h4>
<p>not completely sure about how to start today</p>



<a name="232438553"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232438553" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232438553">(Mar 30 2021 at 14:50)</a>:</h4>
<p>I'm not going to be of any help with <a href="https://github.com/rust-lang/rust/issues/83249">https://github.com/rust-lang/rust/issues/83249</a>, but I can talk about generic const generics</p>



<a name="232438697"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232438697" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232438697">(Mar 30 2021 at 14:51)</a>:</h4>
<p>wave</p>



<a name="232438702"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232438702" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232438702">(Mar 30 2021 at 14:51)</a>:</h4>
<p>i guess a good question is: <span class="user-mention" data-user-id="124288">@oli</span>  <span class="user-mention" data-user-id="121053">@varkor</span> do you know whether we want to evaluate generic consts anywhere?</p>



<a name="232438752"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232438752" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232438752">(Mar 30 2021 at 14:51)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-03-30/near/232438300">said</a>:</p>
<blockquote>
<p>so unless there's something you want to discuss without me, it's probably easiest to just skip that one</p>
</blockquote>
<p>this seems fine</p>



<a name="232438782"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232438782" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232438782">(Mar 30 2021 at 14:51)</a>:</h4>
<p>if unused substs wouldn't exist</p>



<a name="232438903"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232438903" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232438903">(Mar 30 2021 at 14:52)</a>:</h4>
<p>evaluate generic consts as in "while still polymorphic"?</p>



<a name="232438921"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232438921" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232438921">(Mar 30 2021 at 14:52)</a>:</h4>
<p><span class="user-mention" data-user-id="216206">@lcnr</span> you pointed me earlier at some exciting development, too, but I didn't get a chance to read up on it</p>



<a name="232438935"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232438935" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232438935">(Mar 30 2021 at 14:52)</a>:</h4>
<p>yeah</p>



<a name="232438954"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232438954" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232438954">(Mar 30 2021 at 14:52)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-03-30/near/232438921">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> you pointed me earlier at some exciting development, too, but I didn't get a chance to read up on it</p>
</blockquote>
<p>don't have to then</p>



<a name="232438995"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232438995" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232438995">(Mar 30 2021 at 14:52)</a>:</h4>
<p>it's a fairly simple idea i can explain here</p>



<a name="232438999"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232438999" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232438999">(Mar 30 2021 at 14:52)</a>:</h4>
<p>I kind of want to know what it was though :)</p>



<a name="232439000"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232439000" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232439000">(Mar 30 2021 at 14:52)</a>:</h4>
<p>The only reason for that ever to happen is for <code>-Zpolymorphize</code>, and I'm not sure whether that counts?</p>



<a name="232439076"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232439076" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232439076">(Mar 30 2021 at 14:53)</a>:</h4>
<p>yeah, that's what i was able to think of as well</p>



<a name="232439099"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232439099" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232439099">(Mar 30 2021 at 14:53)</a>:</h4>
<p>soooo</p>



<a name="232439130"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232439130" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232439130">(Mar 30 2021 at 14:53)</a>:</h4>
<p>let's start by looking at <a href="https://github.com/rust-lang/rust/issues/83249">https://github.com/rust-lang/rust/issues/83249</a></p>



<a name="232439300"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232439300" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232439300">(Mar 30 2021 at 14:54)</a>:</h4>
<p>here we try to evaluate the array len in <code>foo</code> while <code>T</code> is still an inference variable</p>



<a name="232439364"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232439364" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232439364">(Mar 30 2021 at 14:54)</a>:</h4>
<p>to do that we replace the inference var <code>$0</code> with a placeholder type</p>



<a name="232439471"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232439471" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232439471">(Mar 30 2021 at 14:55)</a>:</h4>
<p><code>^0</code></p>



<a name="232439580"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232439580" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232439580">(Mar 30 2021 at 14:55)</a>:</h4>
<p>we now try to evaluate the array length in the param env of <code>bar</code> (which is empty), with <code>T = ^0</code></p>



<a name="232439617"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232439617" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232439617">(Mar 30 2021 at 14:55)</a>:</h4>
<p>which causes us to encounter <code>&lt;^0 as Foo&gt;::N</code></p>



<a name="232439780"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232439780" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232439780">(Mar 30 2021 at 14:56)</a>:</h4>
<p><em>currently</em>, trying to get the instance for that associated constants causes an ICE because we can't prove <code>^0: Foo</code></p>



<a name="232439954"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232439954" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232439954">(Mar 30 2021 at 14:57)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-03-30/near/232439300">said</a>:</p>
<blockquote>
<p>here we try to evaluate the array len in <code>foo</code> while <code>T</code> is still an inference variable</p>
</blockquote>
<p>where/how/why does this happen?</p>



<a name="232439987"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232439987" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232439987">(Mar 30 2021 at 14:57)</a>:</h4>
<p>while typechecking <code>bar</code></p>



<a name="232440239"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232440239" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232440239">(Mar 30 2021 at 14:59)</a>:</h4>
<p>can you walk through that a bit more for me?</p>



<a name="232440251"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232440251" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232440251">(Mar 30 2021 at 14:59)</a>:</h4>
<p>so, I think that we already know the type of <code>$0</code> at that point due to lazy norm and are just missing a call to <code>resolve_vars_if_possible</code> here</p>



<a name="232440461"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232440461" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232440461">(Mar 30 2021 at 15:00)</a>:</h4>
<p>i am not sure if i can <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="232440561"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232440561" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232440561">(Mar 30 2021 at 15:00)</a>:</h4>
<p>i guess the fundamental question here is: do we want to try and eval consts if they contain inference variables/placeholders?</p>



<a name="232440735"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232440735" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232440735">(Mar 30 2021 at 15:01)</a>:</h4>
<p>my idea at the end of the last meeting was to only evaluate constants if they are fully concrete (ignoring unused substs)</p>



<a name="232440848"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232440848" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232440848">(Mar 30 2021 at 15:02)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-03-30/near/232440561">said</a>:</p>
<blockquote>
<p>i guess the fundamental question here is: do we want to try and eval consts if they contain inference variables/placeholders?</p>
</blockquote>
<p>by that you mean its type containing inference variables, right? not the body of the constant (beyond those variables being in substs)</p>



<a name="232440894"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232440894" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232440894">(Mar 30 2021 at 15:02)</a>:</h4>
<p>yeah, the substs for the const contain infer vars</p>



<a name="232440973"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232440973" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232440973">(Mar 30 2021 at 15:02)</a>:</h4>
<p>doesn't this just delay the problem to CTFE time?</p>



<a name="232441042"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232441042" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232441042">(Mar 30 2021 at 15:03)</a>:</h4>
<p>which problem?</p>



<a name="232441098"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232441098" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232441098">(Mar 30 2021 at 15:03)</a>:</h4>
<p>the ICEing</p>



<a name="232441155"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232441155" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232441155">(Mar 30 2021 at 15:03)</a>:</h4>
<p><code>u8: Foo</code> is provable</p>



<a name="232441165"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232441165" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232441165">(Mar 30 2021 at 15:03)</a>:</h4>
<p>so why would we ice?</p>



<a name="232441344"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232441344" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232441344">(Mar 30 2021 at 15:04)</a>:</h4>
<p>where does the ICE occur exactly?</p>



<a name="232441350"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232441350" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232441350">(Mar 30 2021 at 15:04)</a>:</h4>
<p>do we have a backtrace?</p>



<a name="232441400"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232441400" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232441400">(Mar 30 2021 at 15:05)</a>:</h4>
<p>the issue has one</p>



<a name="232441402"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232441402" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232441402">(Mar 30 2021 at 15:05)</a>:</h4>
<p>also, when you say placeholder... where is the code that is doing the replacement of inference variables with placeholders? is this a canonicalized query?</p>



<a name="232441457"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232441457" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232441457">(Mar 30 2021 at 15:05)</a>:</h4>
<p>we ice in <code>codegen_fulfill_obligation</code></p>



<a name="232441513"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232441513" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232441513">(Mar 30 2021 at 15:05)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-03-30/near/232441402">said</a>:</p>
<blockquote>
<p>also, when you say placeholder... where is the code that is doing the replacement of inference variables with placeholders? is this a canonicalized query?</p>
</blockquote>
<p><a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_infer/infer/struct.InferCtxt.html#method.const_eval_resolve">https://doc.rust-lang.org/nightly/nightly-rustc/rustc_infer/infer/struct.InferCtxt.html#method.const_eval_resolve</a></p>



<a name="232441561"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232441561" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232441561">(Mar 30 2021 at 15:05)</a>:</h4>
<p>yeah, it is</p>



<a name="232441819"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232441819" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232441819">(Mar 30 2021 at 15:07)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-03-30/near/232441165">said</a>:</p>
<blockquote>
<p>so why would we ice?</p>
</blockquote>
<p>I don't really know anything about inference, sorry about these useless questions. I don't know why we ICE at all. Are we iceing because <code>const_eval_resolve</code> will not evaluate things with parameters, thus error, and then that error propagates into inference, even though we could totally evaluate the constant?</p>



<a name="232441929"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232441929" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232441929">(Mar 30 2021 at 15:08)</a>:</h4>
<p>we're icing cause <code>codegen_fulfill_obligation</code> assumes that all predicates it encounters are provable afaict</p>



<a name="232442008"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232442008" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232442008">(Mar 30 2021 at 15:08)</a>:</h4>
<p>and we use <code>codegen_fulfill_obligation</code> when trying to evaluate <code>&lt;^0 as Foo&gt;::N</code> while trying to evaluate the length of <code>[u8; T::N]</code></p>



<a name="232442083"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232442083" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232442083">(Mar 30 2021 at 15:09)</a>:</h4>
<p>oh, so if we evaluated that <code>N</code> a bit later, we'd already know that <code>^0</code> is <code>u8</code> and everything would be fine</p>



<a name="232442131"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232442131" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232442131">(Mar 30 2021 at 15:09)</a>:</h4>
<p>jup</p>



<a name="232442331"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232442331" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232442331">(Mar 30 2021 at 15:10)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-03-30/near/232441929">said</a>:</p>
<blockquote>
<p>we're icing cause <code>codegen_fulfill_obligation</code> assumes that all predicates it encounters are provable afaict</p>
</blockquote>
<p>yeah this code is really meant to be used post monomorphization</p>



<a name="232442387"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232442387" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232442387">(Mar 30 2021 at 15:11)</a>:</h4>
<p>so... could we look at the element type of the array before we look at the length and thus have the <code>InferCx</code> know about the <code>u8</code> before looking at the constant? Or would that just break another case where we first need to ignore the array element type but need the constant in order to infer the array element type?</p>
<p>EDIT: ok, nevermind after reading the above comment about post monomorphization</p>



<a name="232442501"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232442501" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232442501">(Mar 30 2021 at 15:11)</a>:</h4>
<p><code>u8</code> is not inferred from the element type here, but from the return type <code>let _: u8</code></p>



<a name="232442607"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232442607" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232442607">(Mar 30 2021 at 15:12)</a>:</h4>
<p>(reading backtrace)</p>



<a name="232442946"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232442946" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232442946">(Mar 30 2021 at 15:14)</a>:</h4>
<p>what if <code>const_eval_resolve</code> just returned with <code>TooGeneric</code> if there are inference variables in the input to <code>Instance::resolve</code>?</p>



<a name="232442984"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232442984" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232442984">(Mar 30 2021 at 15:14)</a>:</h4>
<p>then "everything" would be fine</p>



<a name="232443020"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232443020" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232443020">(Mar 30 2021 at 15:14)</a>:</h4>
<p>I assume those quotes mean, some code doesn't compile that you want to compile</p>



<a name="232443050"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232443050" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232443050">(Mar 30 2021 at 15:15)</a>:</h4>
<p>no, i assume that all code i want to compile compiles</p>



<a name="232443064"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232443064" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232443064">(Mar 30 2021 at 15:15)</a>:</h4>
<p>oh</p>



<a name="232443115"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232443115" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232443115">(Mar 30 2021 at 15:15)</a>:</h4>
<p>my idea is to return <code>TooGeneric</code> if it encounters either inference variables or parameters</p>



<a name="232443162"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232443162" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232443162">(Mar 30 2021 at 15:15)</a>:</h4>
<p><span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span></p>



<a name="232443184"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232443184" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232443184">(Mar 30 2021 at 15:15)</a>:</h4>
<p>which solves both <a href="https://github.com/rust-lang/rust/issues/83249">#83249</a></p>



<a name="232443252"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232443252" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232443252">(Mar 30 2021 at 15:15)</a>:</h4>
<p>and the issue we talked about in the last meeting</p>



<a name="232443418"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232443418" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232443418">(Mar 30 2021 at 15:16)</a>:</h4>
<p>so I'm still skimming the code <em>but</em> this makes sense to me -- more or less</p>



<a name="232443471"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232443471" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232443471">(Mar 30 2021 at 15:16)</a>:</h4>
<p>I think that the const evaluator should be able to handle inference variables</p>



<a name="232443482"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232443482" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232443482">(Mar 30 2021 at 15:16)</a>:</h4>
<p>without ICEing</p>



<a name="232443700"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232443700" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232443700">(Mar 30 2021 at 15:17)</a>:</h4>
<p>how hard is it for the const eval code to return <code>TooGeneric</code>?</p>



<a name="232443721"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232443721" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232443721">(Mar 30 2021 at 15:17)</a>:</h4>
<p>on inference variables?</p>



<a name="232443793"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232443793" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232443793">(Mar 30 2021 at 15:18)</a>:</h4>
<p>i assume it should <em>just work</em>™</p>



<a name="232443953"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232443953" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232443953">(Mar 30 2021 at 15:18)</a>:</h4>
<p>Yea, that's not the issue, the issue is that we use <code>Instance::resolve</code> liberally without first checking for inference vars</p>



<a name="232443983"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232443983" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232443983">(Mar 30 2021 at 15:19)</a>:</h4>
<p>but in this specific case, we don't even get into the const evaluator</p>



<a name="232444017"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232444017" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232444017">(Mar 30 2021 at 15:19)</a>:</h4>
<p>this is for resolving <em>what</em> to const eval at all</p>



<a name="232444044"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232444044" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232444044">(Mar 30 2021 at 15:19)</a>:</h4>
<p><span class="user-mention silent" data-user-id="124288">oli</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-03-30/near/232443953">said</a>:</p>
<blockquote>
<p>Yea, that's not the issue, the issue is that we use <code>Instance::resolve</code> liberally without first checking for inference vars</p>
</blockquote>
<p>during typeck?</p>



<a name="232444211"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232444211" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232444211">(Mar 30 2021 at 15:20)</a>:</h4>
<p>CTFE itself uses it whenever it sees <em>any</em> unevaluated constant</p>



<a name="232444231"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232444231" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232444231">(Mar 30 2021 at 15:20)</a>:</h4>
<p>jup</p>



<a name="232444260"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232444260" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232444260">(Mar 30 2021 at 15:20)</a>:</h4>
<p>but that's not an issue if we can't reach ctfe with inference vars</p>



<a name="232444270"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232444270" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232444270">(Mar 30 2021 at 15:20)</a>:</h4>
<p>right</p>



<a name="232444327"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232444327" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232444327">(Mar 30 2021 at 15:21)</a>:</h4>
<p>and in order to not reach that, we need to check <a href="https://github.com/rust-lang/rust/blob/673d0db5e393e9c64897005b470bfeb6d5aec61b/compiler/rustc_middle/src/mir/interpret/queries.rs#L41">https://github.com/rust-lang/rust/blob/673d0db5e393e9c64897005b470bfeb6d5aec61b/compiler/rustc_middle/src/mir/interpret/queries.rs#L41</a> and make sure we don't have any inference vars</p>



<a name="232444373"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232444373" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232444373">(Mar 30 2021 at 15:21)</a>:</h4>
<p>so... I think returning Too Generic if we have any infernce variables would be "ok"</p>



<a name="232444388"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232444388" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232444388">(Mar 30 2021 at 15:21)</a>:</h4>
<p>that is, from the outset</p>



<a name="232444417"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232444417" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232444417">(Mar 30 2021 at 15:21)</a>:</h4>
<p>it could be modified later</p>



<a name="232444430"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232444430" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232444430">(Mar 30 2021 at 15:21)</a>:</h4>
<p>to be more precise</p>



<a name="232444489"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232444489" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232444489">(Mar 30 2021 at 15:22)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-03-30/near/232444388">said</a>:</p>
<blockquote>
<p>that is, from the outset</p>
</blockquote>
<p>I don't see how to get into CTFE at all without doing some sort of resolve first, so we won't ever get into CTFE itself.</p>



<a name="232444524"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232444524" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232444524">(Mar 30 2021 at 15:22)</a>:</h4>
<p>in general I don't see any reason that the code has to ICE etc in that particular place, but it'll take some refactoring etc</p>



<a name="232444552"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232444552" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232444552">(Mar 30 2021 at 15:22)</a>:</h4>
<p>well for this particular example maybe</p>



<a name="232444573"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232444573" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232444573">(Mar 30 2021 at 15:22)</a>:</h4>
<p>it doesn't so hard to imagine cases where the inference variable doesn't matter at all</p>



<a name="232444626"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232444626" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232444626">(Mar 30 2021 at 15:23)</a>:</h4>
<p>with generic const generics I could see how we could end up with inference vars in constants where the inference var doesn't matter, yea</p>



<a name="232444645"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232444645" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232444645">(Mar 30 2021 at 15:23)</a>:</h4>
<p>e.g., a constant like <code>1 + &lt;u8 as Trait&lt;?U&gt;&gt;::Foo</code> where you have</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">impl</span><span class="o">&lt;</span><span class="n">X</span><span class="o">&gt;</span><span class="w"> </span><span class="n">Trait</span><span class="o">&lt;</span><span class="n">X</span><span class="o">&gt;</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="kt">u8</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">const</span><span class="w"> </span><span class="n">Foo</span>: <span class="kt">usize</span> <span class="o">=</span><span class="w"> </span><span class="mi">2</span><span class="p">;</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="232444665"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232444665" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232444665">(Mar 30 2021 at 15:23)</a>:</h4>
<p>unless I'm missing something</p>



<a name="232444817"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232444817" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232444817">(Mar 30 2021 at 15:24)</a>:</h4>
<p>here <code>?U</code> should not matter i think</p>



<a name="232444882"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232444882" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232444882">(Mar 30 2021 at 15:24)</a>:</h4>
<p>i guess... do we want to look into that associated const if <code>?U</code> is a parameter/inference var?</p>



<a name="232444918"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232444918" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232444918">(Mar 30 2021 at 15:25)</a>:</h4>
<p>at which point we're back at the <code>const_evaluatable_unchecked</code> future compat warning</p>



<a name="232444973"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232444973" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232444973">(Mar 30 2021 at 15:25)</a>:</h4>
<p>i personally would prefer us to not look into that constant</p>



<a name="232444993"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232444993" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232444993">(Mar 30 2021 at 15:25)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-03-30/near/232444817">said</a>:</p>
<blockquote>
<p>here <code>?U</code> should not matter i think</p>
</blockquote>
<p>I agree it doesn't matter</p>



<a name="232445060"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232445060" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232445060">(Mar 30 2021 at 15:26)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-03-30/near/232444882">said</a>:</p>
<blockquote>
<p>i guess... do we want to look into that associated const if <code>?U</code> is a parameter/inference var?</p>
</blockquote>
<p>I don't really know what "look into" means here I guess</p>



<a name="232445088"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232445088" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232445088">(Mar 30 2021 at 15:26)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-03-30/near/232444993">said</a>:</p>
<blockquote>
<p>I agree it doesn't matter</p>
</blockquote>
<p>well, sort of</p>



<a name="232445116"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232445116" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232445116">(Mar 30 2021 at 15:26)</a>:</h4>
<p>"look into": evaluate them <span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span></p>



<a name="232445144"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232445144" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232445144">(Mar 30 2021 at 15:26)</a>:</h4>
<p>or like</p>



<a name="232445150"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232445150" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232445150">(Mar 30 2021 at 15:26)</a>:</h4>
<p>care about their body</p>



<a name="232445221"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232445221" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232445221">(Mar 30 2021 at 15:27)</a>:</h4>
<p>which are two separate things for stuff like</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">impl</span><span class="o">&lt;</span><span class="n">X</span><span class="o">&gt;</span><span class="w"> </span><span class="n">Trait</span><span class="o">&lt;</span><span class="n">X</span><span class="o">&gt;</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="kt">u8</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">const</span><span class="w"> </span><span class="n">Foo</span>: <span class="kt">usize</span> <span class="o">=</span><span class="w"> </span><span class="n">std</span>::<span class="n">mem</span>::<span class="n">size_of</span>::<span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="p">();</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="232445446"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232445446" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232445446">(Mar 30 2021 at 15:28)</a>:</h4>
<p>well</p>



<a name="232445480"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232445480" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232445480">(Mar 30 2021 at 15:28)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-03-30/near/232444918">said</a>:</p>
<blockquote>
<p>at which point we're back at the <code>const_evaluatable_unchecked</code> future compat warning</p>
</blockquote>
<p>explain to me this</p>



<a name="232445494"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232445494" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232445494">(Mar 30 2021 at 15:28)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-03-30/near/232444973">said</a>:</p>
<blockquote>
<p>i personally would prefer us to not look into that constant</p>
</blockquote>
<p>though there are some cases where <em>even I</em> do not want to deal with associated const as opaque projections</p>



<a name="232445523"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232445523" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232445523">(Mar 30 2021 at 15:29)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-03-30/near/232444973">said</a>:</p>
<blockquote>
<p>i personally would prefer us to not look into that constant</p>
</blockquote>
<p>if there is anything that "scares" me about const generics, it's that I feel like we still don't have clear alignment on what equality ought to mean somehow</p>



<a name="232445738"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232445738" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232445738">(Mar 30 2021 at 15:30)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">struct</span> <span class="nc">Foo</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="p">(</span><span class="n">T</span><span class="p">);</span><span class="w"></span>

<span class="k">impl</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="w"> </span><span class="n">Foo</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">const</span><span class="w"> </span><span class="n">ASSOC</span>: <span class="kt">usize</span> <span class="o">=</span><span class="w"> </span><span class="mi">17</span><span class="p">;</span><span class="w"></span>

<span class="w">    </span><span class="k">fn</span> <span class="nf">test</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="kd">let</span><span class="w"> </span><span class="n">_</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">[</span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="bp">Self</span>::<span class="n">ASSOC</span><span class="p">];</span><span class="w"></span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="232445778"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232445778" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232445778">(Mar 30 2021 at 15:30)</a>:</h4>
<p>is the length of <code>[0; Self::ASSOC]</code> generic here?</p>



<a name="232445836"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232445836" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232445836">(Mar 30 2021 at 15:31)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-03-30/near/232445523">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-03-30/near/232444973">said</a>:</p>
<blockquote>
<p>i personally would prefer us to not look into that constant</p>
</blockquote>
<p>if there is anything that "scares" me about const generics, it's that I feel like we still don't have clear alignment on what equality ought to mean somehow</p>
</blockquote>
<p>.... yes .....</p>



<a name="232446062"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232446062" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232446062">(Mar 30 2021 at 15:32)</a>:</h4>
<p>I think a T-lang MCP for this is too small, fixing the meaning of equality needs an RFC, right?</p>



<a name="232446095"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232446095" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232446095">(Mar 30 2021 at 15:32)</a>:</h4>
<p>agreed, but I think it's what we're most wanting</p>



<a name="232446105"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232446105" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232446105">(Mar 30 2021 at 15:32)</a>:</h4>
<p>I mean... it's mostly making a decision, not like we need to figure out ... that</p>



<a name="232446134"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232446134" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232446134">(Mar 30 2021 at 15:32)</a>:</h4>
<p>I .. think we need to figure it out too</p>



<a name="232446162"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232446162" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232446162">(Mar 30 2021 at 15:32)</a>:</h4>
<p>at least I don't yet feel like I have a good understanding</p>



<a name="232446168"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232446168" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232446168">(Mar 30 2021 at 15:32)</a>:</h4>
<p>i think we need to mostly figure out tbh <span aria-label="rolling on the floor laughing" class="emoji emoji-1f923" role="img" title="rolling on the floor laughing">:rolling_on_the_floor_laughing:</span></p>



<a name="232446216"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232446216" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232446216">(Mar 30 2021 at 15:33)</a>:</h4>
<p>I should have finished that sentence</p>



<a name="232446238"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232446238" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232446238">(Mar 30 2021 at 15:33)</a>:</h4>
<p>but I think to answer your question, <span class="user-mention" data-user-id="216206">@lcnr</span>, I sort of expect we ultimately want to treat it exactly like we treat associated type projection</p>



<a name="232446251"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232446251" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232446251">(Mar 30 2021 at 15:33)</a>:</h4>
<p>which is to say that we kind of normalize as much as we can</p>



<a name="232446286"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232446286" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232446286">(Mar 30 2021 at 15:33)</a>:</h4>
<p>and if there are inference variables whose value we need to know to proceed, that's kind of an "unambiguous" thing that stalls until we learn more about the value of that inference variable</p>



<a name="232446304"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232446304" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232446304">(Mar 30 2021 at 15:33)</a>:</h4>
<p>exacatly how we construct that -- what the primitives are and how they fit together -- is a bit opaque to me now</p>



<a name="232446388"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232446388" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232446388">(Mar 30 2021 at 15:34)</a>:</h4>
<p>but I think that so long as we treat the presence of inference variables as a source of <em>ambiguity</em> we should be forwards compatible</p>



<a name="232446391"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232446391" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232446391">(Mar 30 2021 at 15:34)</a>:</h4>
<blockquote>
<p>I sort of expect we ultimately want to treat it exactly like we treat associated type projection</p>
</blockquote>
<p>that i my idea for anonymous constant</p>



<a name="232446457"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232446457" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232446457">(Mar 30 2021 at 15:34)</a>:</h4>
<p>cause we have no backcompat issues there as they can't yet depend on generic params</p>



<a name="232446555"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232446555" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232446555">(Mar 30 2021 at 15:35)</a>:</h4>
<p>doing so for associated constants is a bit harder, as we already allow arbitrarily complex expressions there</p>



<a name="232446630"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232446630" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232446630">(Mar 30 2021 at 15:35)</a>:</h4>
<p>what makes it harder exactly?</p>



<a name="232446638"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232446638" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232446638">(Mar 30 2021 at 15:35)</a>:</h4>
<p>and i don't think that we are/will be able to check for equality in these cases</p>



<a name="232446750"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232446750" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232446750">(Mar 30 2021 at 15:36)</a>:</h4>
<p>the way i look at <code>const_evaluatable_checked</code>, or just generic constants</p>



<a name="232446768"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232446768" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232446768">(Mar 30 2021 at 15:36)</a>:</h4>
<p>is that while constants are still generic</p>



<a name="232446911"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232446911" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232446911">(Mar 30 2021 at 15:37)</a>:</h4>
<p>we compare them by looking at some kind of ast</p>



<a name="232447012"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232447012" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232447012">(Mar 30 2021 at 15:38)</a>:</h4>
<p>so <code>1 + N</code> would be <code>Add(Const(1), Param(N))</code></p>



<a name="232447102"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232447102" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232447102">(Mar 30 2021 at 15:38)</a>:</h4>
<p>and to unify we pretty much do the same thing we already do for type projections (where each ast node behaves like a projection)</p>



<a name="232447133"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232447133" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232447133">(Mar 30 2021 at 15:39)</a>:</h4>
<p>doing this for arbitrary expressions is hard</p>



<a name="232447144"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232447144" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232447144">(Mar 30 2021 at 15:39)</a>:</h4>
<p>cause they can both be:</p>



<a name="232447186"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232447186" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232447186">(Mar 30 2021 at 15:39)</a>:</h4>
<ul>
<li>not a tree (e.g. cyclic <code>while ... { .. }</code>)</li>
</ul>



<a name="232447245"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232447245" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232447245">(Mar 30 2021 at 15:39)</a>:</h4>
<ul>
<li>some kind of desugaring which somewhat stabilizes the way we desugar stuff</li>
</ul>



<a name="232447405"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232447405" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232447405">(Mar 30 2021 at 15:40)</a>:</h4>
<p>does that seem roughly sensible to you?</p>



<a name="232447457"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232447457" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232447457">(Mar 30 2021 at 15:41)</a>:</h4>
<p>it's a kind of dense and unclear explanation tbh</p>



<a name="232447496"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232447496" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232447496">(Mar 30 2021 at 15:41)</a>:</h4>
<p>AST structural equality kinda <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span></p>



<a name="232447588"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232447588" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232447588">(Mar 30 2021 at 15:42)</a>:</h4>
<p>(not the rust ast, <code>AbstractConst</code>s are also an abstract syntax? tree)</p>



<a name="232447618"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232447618" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232447618">(Mar 30 2021 at 15:42)</a>:</h4>
<p><del>maybe not syntax <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></del></p>



<a name="232447665"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232447665" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232447665">(Mar 30 2021 at 15:42)</a>:</h4>
<p><em>Custom</em>AST structural equality xd</p>



<a name="232447689"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232447689" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232447689">(Mar 30 2021 at 15:42)</a>:</h4>
<p>time to look at the definition for syntax</p>



<a name="232447721"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232447721" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232447721">(Mar 30 2021 at 15:43)</a>:</h4>
<p>I mean it's kind of a syntax</p>



<a name="232447752"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232447752" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232447752">(Mar 30 2021 at 15:43)</a>:</h4>
<p>a much more bare bones one than surface level rust lol</p>



<a name="232447767"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232447767" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232447767">(Mar 30 2021 at 15:43)</a>:</h4>
<p>but still ^^</p>



<a name="232448803"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232448803" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232448803">(Mar 30 2021 at 15:49)</a>:</h4>
<p>There's no hope of equating arbitrary expressions, and it's not worth trying to be very clever about it. Some very simple handling like <code>1 + N</code> or <code>N + 1</code> for integers would surely be enough for 99% of use cases.</p>



<a name="232448975"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232448975" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232448975">(Mar 30 2021 at 15:50)</a>:</h4>
<p>Is there a general feeling that now is the right time to work out precisely how const generic equality should work?</p>



<a name="232449054"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232449054" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232449054">(Mar 30 2021 at 15:51)</a>:</h4>
<p>I think we need to be able to equate arbitrary expressions</p>



<a name="232449137"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232449137" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232449137">(Mar 30 2021 at 15:52)</a>:</h4>
<p>Do you mean arbitrary expressions that are literally syntactically the same?</p>



<a name="232449294"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232449294" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232449294">(Mar 30 2021 at 15:52)</a>:</h4>
<p>that or something else, we need <em>some</em> way to tell that two expressions are the same or else we cant return types that have "too complicated" const expressions in them</p>



<a name="232449372"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232449372" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232449372">(Mar 30 2021 at 15:53)</a>:</h4>
<p>my solution is to put the "too complicated" behind some barrier</p>



<a name="232449380"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232449380" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232449380">(Mar 30 2021 at 15:53)</a>:</h4>
<p>either a function</p>



<a name="232449404"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232449404" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232449404">(Mar 30 2021 at 15:53)</a>:</h4>
<p>Yeah, I was thinking more of expressions that were not syntactically identical. I don't see why we can't just compare the <code>AbstractConst</code> representations directly as trees for the latter?</p>



<a name="232449417"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232449417" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232449417">(Mar 30 2021 at 15:53)</a>:</h4>
<p>or an associated constant, as we can't restrict them</p>



<a name="232449421"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232449421" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232449421">(Mar 30 2021 at 15:53)</a>:</h4>
<p>i was thinking of "ltierally syntactically" when I said it but really anything to allow us to unify arbitrary expressions works</p>



<a name="232449467"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232449467" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232449467">(Mar 30 2021 at 15:53)</a>:</h4>
<p><span class="user-mention silent" data-user-id="121053">varkor</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-03-30/near/232449404">said</a>:</p>
<blockquote>
<p>Yeah, I was thinking more of expressions that were not syntactically identical. I don't see why we can't just compare the <code>AbstractConst</code> representations directly as trees for the latter?</p>
</blockquote>
<p>I think this is how we currently do it</p>



<a name="232449473"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232449473" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232449473">(Mar 30 2021 at 15:53)</a>:</h4>
<blockquote>
<p>directly as trees for the latter</p>
</blockquote>
<p>that's what i want to do, yeah</p>



<a name="232449545"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232449545" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232449545">(Mar 30 2021 at 15:54)</a>:</h4>
<p>"what I want to do" is this not how it already works <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="232449758"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232449758" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232449758">(Mar 30 2021 at 15:55)</a>:</h4>
<p>the current state is kind of a mess, so i am pretending like it doesn't exist rn</p>



<a name="232449794"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232449794" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232449794">(Mar 30 2021 at 15:55)</a>:</h4>
<p>okay that works for me</p>



<a name="232450037"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232450037" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232450037">(Mar 30 2021 at 15:57)</a>:</h4>
<p>the current implementation of <code>try_unify</code> for abstract consts tries to do this and treats associated constants like type projections which can only be normalized to their final value</p>



<a name="232450165"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232450165" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232450165">(Mar 30 2021 at 15:57)</a>:</h4>
<p>Can't associated constants just use equality of paths?</p>



<a name="232450242"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232450242" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232450242">(Mar 30 2021 at 15:58)</a>:</h4>
<p><code>DefId</code> equality?</p>



<a name="232450258"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232450258" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232450258">(Mar 30 2021 at 15:58)</a>:</h4>
<p>Yeah</p>



<a name="232450277"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232450277" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232450277">(Mar 30 2021 at 15:58)</a>:</h4>
<p>jup, we do that</p>



<a name="232450302"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232450302" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232450302">(Mar 30 2021 at 15:58)</a>:</h4>
<p>Ah, okay <span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span></p>



<a name="232450976"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232450976" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232450976">(Mar 30 2021 at 16:02)</a>:</h4>
<p>do we currently unify associated constants by directly evaluating them if they're concrete?</p>



<a name="232451068"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232451068" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232451068">(Mar 30 2021 at 16:02)</a>:</h4>
<p>don't think so, we don't evaluate <code>ConstKind::Unevaluated</code> in <code>try_unify</code> at all</p>



<a name="232451104"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232451104" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232451104">(Mar 30 2021 at 16:02)</a>:</h4>
<p>alright</p>



<a name="232451229"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232451229" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232451229">(Mar 30 2021 at 16:03)</a>:</h4>
<p>I personally would like to unify <code>Add(Const(2), Param(N))</code> with <code>Add(Add(Const(1), Const(1)), Param(N))</code> by evaluating concrete subtrees</p>



<a name="232451460"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232451460" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232451460">(Mar 30 2021 at 16:04)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-03-30/near/232451068">said</a>:</p>
<blockquote>
<p>don't think so, we don't evaluate <code>ConstKind::Unevaluated</code> in <code>try_unify</code> at all</p>
</blockquote>
<p>we also don't evaluate fully concrete anon consts, which is something i strongly believe we should do</p>



<a name="232451732"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232451732" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232451732">(Mar 30 2021 at 16:06)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-03-30/near/232451229">said</a>:</p>
<blockquote>
<p>I personally would like to unify <code>Add(Const(2), Param(N))</code> with <code>Add(Add(Const(1), Const(1)), Param(N))</code> by evaluating concrete subtrees</p>
</blockquote>
<p>aaaaaaaaaaaaaaaaaaah</p>



<a name="232451758"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232451758" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232451758">(Mar 30 2021 at 16:06)</a>:</h4>
<p>the old tree based const evaluator is back</p>



<a name="232451788"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232451788" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232451788">(Mar 30 2021 at 16:06)</a>:</h4>
<p>YES, WE ALREADY TALKED ABOUT THIS OLI</p>



<a name="232451811"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232451811" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232451811">(Mar 30 2021 at 16:06)</a>:</h4>
<p>oops</p>



<a name="232451860"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232451860" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232451860">(Mar 30 2021 at 16:06)</a>:</h4>
<p>YOU SAID IT WAS "ok <span aria-label="unamused" class="emoji emoji-1f612" role="img" title="unamused">:unamused:</span> " IF I REUSE MIRI FOR IT</p>



<a name="232451876"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232451876" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232451876">(Mar 30 2021 at 16:07)</a>:</h4>
<p>I remember that</p>



<a name="232451906"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232451906" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232451906">(Mar 30 2021 at 16:07)</a>:</h4>
<p>still my opinion, go for it</p>



<a name="232451924"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232451924" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232451924">(Mar 30 2021 at 16:07)</a>:</h4>
<p>I'm not against it. I think I'm mostly amused <span aria-label="grinning" class="emoji emoji-1f600" role="img" title="grinning">:grinning:</span></p>



<a name="232454807"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232454807" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232454807">(Mar 30 2021 at 16:25)</a>:</h4>
<p>What's the alternative?</p>



<a name="232455025"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232455025" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232455025">(Mar 30 2021 at 16:26)</a>:</h4>
<p>to not evaluate concrete subtrees <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="232455336"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232455336" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232455336">(Mar 30 2021 at 16:28)</a>:</h4>
<p><span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span></p>



<a name="232456711"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232456711" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232456711">(Mar 30 2021 at 16:37)</a>:</h4>
<p>that seems tough</p>



<a name="232456719"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232456719" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232456719">(Mar 30 2021 at 16:37)</a>:</h4>
<p>lol</p>



<a name="232513108"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232513108" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232513108">(Mar 30 2021 at 23:25)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-03-30/near/232451229">said</a>:</p>
<blockquote>
<p>I personally would like to unify <code>Add(Const(2), Param(N))</code> with <code>Add(Add(Const(1), Const(1)), Param(N))</code> by evaluating concrete subtrees</p>
</blockquote>
<p>By the way, this exposes evaluation order issues, because if you evaluate <code>N + (1 + 1)</code> to <code>N + 2</code> that means that <code>1 + 1</code> is getting evaluated before <code>N</code>, and you can probably use <code>let mut</code> in a block to make this observable. So you would need to check that the expression is pure somehow. (Right now it seems that mut refs are not allowed in const fn without the <code>const_mut_refs</code> feature, but I guess it is eventually supposed to be possible.)</p>



<a name="232554368"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232554368" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232554368">(Mar 31 2021 at 08:35)</a>:</h4>
<p>we're already forbidding most expressions, so you can't have mutable variables or statements in general and still have it be legal. Anything more complex than simple math should go into separate const fn, and then we only check for the const fn call, not the body</p>



<a name="232619608"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232619608" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232619608">(Mar 31 2021 at 16:15)</a>:</h4>
<p>don’t we still need to be careful even with simple expressions like <code>N + (1 - 2)</code> vs <code>(N + 1) - 2</code>, because of overflow ?</p>



<a name="232627144"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232627144" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232627144">(Mar 31 2021 at 16:59)</a>:</h4>
<p>such expressions contain an overflow check that you don't see, so they won't be unifyable I guess. But the concrete subtree evaluation could eliminate these overflow checks if it encounters them and realizes they cannot trigger</p>



<a name="232627228"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232627228" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232627228">(Mar 31 2021 at 17:00)</a>:</h4>
<p><code>N + (2 - 1)</code> also contains an overflow check, but during concrete subtree evaluation we'd "just go ahead and try it", and error if it fails</p>



<a name="232627347"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-03-30/near/232627347" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-03-30.html#232627347">(Mar 31 2021 at 17:00)</a>:</h4>
<p>(this is why I want all operations to go through miri <span aria-label="stuck out tongue" class="emoji emoji-1f61b" role="img" title="stuck out tongue">:stuck_out_tongue:</span>)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>